Skip to main content

foregroundColor

Type

property

Summary

Specifies the color of object text and borders.

Syntax

set the foregroundColor of <object> to {empty | <colorName> | <RGBColor>}
set the foregroundColor of [<chunk> of] <field> to {empty| <colorName> | <RGBColor>}

Description

Use the foregroundColor property to change the color of text or the color that fills an object.

Setting the foregroundColor of an object to empty allows the foregroundColor of the object's owner to show through. Use the effective keyword to find out what color is used for the object, even if its own foregroundColor is empty.

The setting of the foregroundColor property has different effects, depending on the object type:

  • The foregroundColor of a stack, card, or group determines the foregroundColor of each object in the stack, card, or group that does not have its own foregroundColor.

  • The foregroundColor of a button is used for the text of the button. If the button's showName property is false, the foregroundColor has no effect.

  • The foregroundColor of a field determines the color of the field's text. If you set the foregroundColor of a chunk of a field, only that chunk is affected. If a chunk of text contains text of more than one color, the foregroundColor of that chunk reports "mixed".

The foregroundColor also determines the color of the blinking insertion point when it is in the field.

  • The foregroundColor of a scrollbar determines the text color used to show the value of the scrollbar's current position. If the scrollbar's showValue property is false, the foregroundColor has no effect.

  • The foregroundColor of a graphic determines the color of the graphic's outline. (The graphic's border is outside the outline. By default, the showBorder property of newly-created graphics is set to false, so this border is not visible.)

  • The foregroundColor of a player, audio clip, video clip, or EPS object has no effect.

  • The foregroundColor of an image is the first color in the image's color palette.

If an object's foregroundPattern is set, the pattern is shown instead of the color specified by foregroundColor.

Examples

set the foregroundColor of button "Help!" to "red"
set the foregroundColor of this card to "#FF00FF"
set the foregroundColor of the mouseChunk to 0,255,0

property: linkColor, HTMLText, owner, showBorder, showName, showValue, linkHiliteColor, foregroundPattern, RTFText

command: answer color, group

function: mouseColor, value

glossary: object, property, color palette, HTML, hexadecimal, video clip, integer, keyword, audio clip, chunk, color reference, insertion point, object type, EPS

keyword: image, effective, default, button, field, player, card, scrollbar, graphic

object: graphic, button, scrollbar, stack, field, image

Compatibility and Support

Introduced

LiveCode 1.0

OS

mac

windows

linux

ios

android

Platforms

desktop

server

mobile

Thank you for your feedback!

Was this page helpful?